#include<stdio.h>
#define maxsize 100

typedef struct{
char data[maxsize];
int length;
}Ip; 

void addch(Ip &ip,char ch){
	ip.data[ip.length]=ch;
	ip.length++;
}

Ip adddot(Ip ip){
	addch(ip,'.'); 
    return ip; 
}

void solveip(char s[],int n,int start,int step,Ip ip){
	if(start<=n){
	if(start==n&&step==4){
		for(int i=0;i<ip.length;i++)
		printf("%c",ip.data[i]);
		printf("\n");
	} 
	} 
    int num=0;
    for(int i<=n;i<n&&i<start+3;i++)
    {num=10*num+(s[i]-'0');
    if(num<=255){
    	addch(ip,s[i]);
    	solveip(s,n,i+1,step+1,adddot(ip));
	}
	if(num==0) break;
	}
}

int main(){
	char s[maxsize]="25525511135";
	int n=11;
	Ip ip;
	ip.length=0;
	solveip(s,n,0,0,ip);
	return 1;
} 




















